Skip to content

fix(types): export structured error details - #1082

Merged
bokelley merged 4 commits into
mainfrom
issue-1031-oauth
Aug 25, 2026
Merged

fix(types): export structured error details#1082
bokelley merged 4 commits into
mainfrom
issue-1031-oauth

Conversation

@bokelley

@bokelley bokelley commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • export all generated structured error-detail models from the supported adcp.types surface
  • export ActionNotAllowedReason, which is required to construct ActionNotAllowedDetails
  • keep lazy, eager, type-checking, and public API snapshot surfaces synchronized

Fixes #1080.

Validation

  • uv run pytest -q tests/test_lazy_types.py tests/test_import_layering.py tests/test_public_api.py
  • make lint
  • make typecheck-all
  • full suite: 7,262 passing tests before correcting the sole new test-scope failure; focused corrected regressions pass
  • pre-commit hooks

Comment thread tests/test_public_api.py Outdated
]

for type_name in error_detail_types:
assert getattr(adcp, type_name) is getattr(types, type_name)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MUST FIX: This assertion resolves every name via getattr(adcp, ...) on the root package, but the PR only exports these from adcp.typessrc/adcp/__init__.py is untouched. Root resolution goes solely through _LAZY (built from the static _LAZY_MODULES) plus submodule passthrough; there is no fallback to adcp.types. Of the 18 names in error_detail_types, only AuthorizationRequiredDetails is in root _LAZY_MODULES. Every other name — including the pre-existing UnsupportedRefinementDimensionDetails and all 17 new ones — raises AttributeError here, so this test fails deterministically. The PR body's "and the package root" is also unmet: from adcp import ActionNotAllowedDetails raises ImportError. Fix: add the 17 names to _LAZY_MODULES["adcp.types"], root __all__, the TYPE_CHECKING block, and the snapshot's adcp section — matching the AuthorizationRequiredDetails precedent.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Request changes

Request changes — 1 blocking finding.

Blocking findings

  • tests/test_public_api.py:143 — New test asserts a root-package (adcp) export that the PR never wires; src/adcp/__init__.py is not updated, so the test fails deterministically.

The PR correctly re-exports the 17 structured error-detail models through the adcp.types facade (types/__init__.py, _eager.py) with matching snapshot, but the stated "package root" export is not delivered. Either wire the re-export into src/adcp/__init__.py or narrow the test to the adcp.types surface actually exported. Row 1 of the decision table applies (a high-severity finding is present).

Blocking findings

  • tests/test_public_api.py:143 — New test asserts root-package export the PR never wires; fails deterministically

@bokelley

Copy link
Copy Markdown
Contributor Author

Addressed the automated review finding in b53fdc9: the regression now verifies the requested supported adcp.types surface only. The focused export, lazy/eager equivalence, and public snapshot tests pass.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — prior blocking finding resolved, no current findings.

This is a subsequent review. The prior run flagged one high finding (tests/test_public_api.py:143 — test asserted a root-adcp export the PR never wired, failing deterministically). The delta in this push fixes exactly that: test_structured_error_details_are_exported drops the root-package import adcp and switches its assertion from getattr(adcp, name) is getattr(types, name) to getattr(types, name).__name__ == name, checking only the adcp.types surface this PR actually adds. All 19 names resolve through the PEP 562 facade (_RESOLVABLE = __all__ | extras, backed by _eager) and each error-detail class is directly named in generated_poc/error_details/**, so .__name__ matches. The prior blocker is gone and the reviewer surfaced no new findings.

Decision-table walk: no critical/high findings (row 1 no) — the prior high was resolved. gated_paths is false (row 2 no). high_risk is true but reasons are (modified) with zero medium findings, so rows 3/4/5 do not fire. Prior decision was request-changes, not escalate, so row 6 does not apply. No no-auto-approve team match (row 7 no). Zero medium findings (row 8 no). Falls through to row 9 — approve. Net improvement over the prior pass.

@bokelley
bokelley enabled auto-merge (squash) August 25, 2026 05:43
@bokelley
bokelley merged commit 6174159 into main Aug 25, 2026
28 checks passed
@bokelley
bokelley deleted the issue-1031-oauth branch August 25, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export the error-details models from adcp.types (14 of 15 are unreachable outside generated_poc)

1 participant